package com.zj.demo01.mapper;

import com.zj.demo01.entity.Air;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AirMapper {
    List<Air> findBydistrictID();

    //添加数据
    @Insert("insert into air_quality_index (district_id, monitor_time, pm10, pm25, monio0tiring_Station) " +
            "values (#{districtId},#{monitorTime},#{pm10},#{pm25},#{monitoringStation})")
    int insert(Air air);
    @Update("update air_quality_index set district_id = #{districtId},monitor_time =#{monitorTime},pm10 = #{pm10},pm25 = #{pm25},monio0tiring_Station=#{monitoringStation} " +
            "where id = #{id}")
      int updateById(Air air);
    @Delete("delete from air_quality_index where id = #{id}")
    int deleteByID(@Param("id") Integer id);
}
